package com.njust.common;

import com.njust.utils.Paging;
import com.njust.vo.PageVO.PageResultVo;

import java.util.List;

public class CommonMethod {
    public static PageResultVo packingPage(List list ,Paging pagination,Integer pageSize,Integer page){
        PageResultVo pageResultVo = new PageResultVo();
        pageResultVo.setTotalNum(pagination.getTotalNum());
        pageResultVo.setList(list);
        pageResultVo.setPageNum(page);
        pageResultVo.setPageSize(pageSize);
        pageResultVo.setPages(pagination.getTotalPage());
        pageResultVo.setSize(list.size());
        return pageResultVo;
    }
}
